import * as TYPES from '../../actions/actionTypes'

const initialState = {
    loading: false,
    inv_code: '',
    inv_time: '',
    state: '',
    itemTitle: '',
    goodsItem: {},
    dataList: null,
}

export default function ResultSerails(state = initialState, action) {
    switch (action.type) {
        case TYPES.INVERTORY_DETAIL_RESULT_SERIAL_INITIAL:
            return {
                ...state,
                inv_code: action.data.inv_code,
                inv_time: action.data.inv_time,
                state: action.data.state,
                itemTitle: action.data.itemTitle,
                goodsItem: action.data.goodsItem,
            }
        case TYPES.INVERTORY_DETAIL_RESULT_SERIAL__DATA_ING:
            return {
                ...state,
                loading: true,

            };
        case TYPES.INVERTORY_DETAIL_RESULT_SERIAL__DATA_SUCCESS:
            return {
                ...state,
                loading: false,
                dataList: action.dataList
            }
        default:
            return state
    }
}